package com.caishi.lkx.exam.vo;


import com.caishi.lkx.exam.ienum.type.QuestionType;

import java.util.concurrent.ScheduledFuture;

// 添加题目状态类，题目答案
public class RoomQuestionStateVo {

    private String questionId;
    private QuestionType type;
    private Object answer;
    private String player1Id;
    private String player2Id;

    private boolean player1Submitted = false; // 玎家1是否提交
    private boolean player2Submitted = false; // 玎家2是否提交
//    前端获取试题时，生成那时的时间戳,
    private Long time;

    private ScheduledFuture<?> timeoutTask; // 超时任务
//    为什么要这个所呢？currentHashMap不是支持并发吗
    private final Object lock = new Object(); // 同步锁

    public Long getTime() {
        return time;
    }

    public void setTime(Long time) {
        this.time = time;
    }

    public String getPlayer1Id() {
        return player1Id;
    }

    public void setPlayer1Id(String player1Id) {
        this.player1Id = player1Id;
    }

    public String getPlayer2Id() {
        return player2Id;
    }

    public void setPlayer2Id(String player2Id) {
        this.player2Id = player2Id;
    }

    public String getQuestionId() {
        return questionId;
    }

    public void setQuestionId(String questionId) {
        this.questionId = questionId;
    }

    public QuestionType getType() {
        return type;
    }

    public void setType(QuestionType type) {
        this.type = type;
    }

    public Object getAnswer() {
        return answer;
    }

    public void setAnswer(Object answer) {
        this.answer = answer;
    }

    public boolean getPlayer1Submitted() {
        return player1Submitted;
    }

    public void setPlayer1Submitted(boolean player1Submitted) {
        this.player1Submitted = player1Submitted;
    }

    public boolean getPlayer2Submitted() {
        return player2Submitted;
    }

    public void setPlayer2Submitted(boolean player2Submitted) {
        this.player2Submitted = player2Submitted;
    }

    public ScheduledFuture<?> getTimeoutTask() {
        return timeoutTask;
    }

    public void setTimeoutTask(ScheduledFuture<?> timeoutTask) {
        this.timeoutTask = timeoutTask;
    }

    public Object getLock() {
        return lock;
    }

    public boolean isPlayer1Submitted() {
        return player1Submitted;
    }

    public boolean isPlayer2Submitted() {
        return player2Submitted;
    }
}





